package 并发编程09.安全发布类型3;

/**
 * 加了锁的懒汉式
 *
 * @author idea
 * @data 2019/1/24
 */
public class SingletonDemo3 {


    private static SingletonDemo3 instance = null;

    public static synchronized SingletonDemo3 getInstance() {
        if (instance != null) {
            return instance;
        } else {
            instance = new SingletonDemo3();
            return instance;
        }
    }

}
